<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title>Title</title>
    <link rel="stylesheet" href="/layui/css/layui.css"/>
</head>
<body>
<script src="/layui/layui.js"></script>
<script>
    layui.use('layer', function(){
        var layer = layui.layer;

        layer.confirm('纳尼？', {
            btn: ['按钮一', '按钮二', '按钮三'] //可以无限个按钮
            ,btn3: function(index, layero){
                //按钮【按钮三】的回调
            }
        }, function(index, layero){
            //按钮【按钮一】的回调
        }, function(index){
            //按钮【按钮二】的回调
        });

        layer.open({
            content: 'test'
            ,btn: ['按钮四', '按钮五', '按钮六']
            ,yes: function(index, layero){
                //按钮【按钮一】的回调
            }
            ,btn2: function(index, layero){
                //按钮【按钮二】的回调

                //return false 开启该代码可禁止点击该按钮关闭
            }
            ,btn3: function(index, layero){
                //按钮【按钮三】的回调

                //return false 开启该代码可禁止点击该按钮关闭
            }
            ,cancel: function(){
                //右上角关闭回调

                //return false 开启该代码可禁止点击该按钮关闭
            }
        });
    });

</script>

</body>
</html>